<template>
	<light-skeleton v-if="lightskelet" />
	<view style="background: #F8F8F8;background-size: 600rpx;background-repeat: no-repeat;background-position-y: bottom;background-position-x: 220%;" v-else>
	<view style="height: auto;">
		<div class="test-component">
		  <hm-friends-list :options="list"></hm-friends-list>
		</div>
	</view>
	<scroll-view class="dialogue">
		<view class="right">
			小度小度，灯光太暗/亮了
		</view>
		<view class="right">
			小度小度，我起床了
		</view>
		<view class="right">
			小度小度，我要睡觉了
		</view>
		<view class="right">
			小度小度，我要洗澡了
		</view>
		<view class="right">
			小度小度，我要工作了
		</view>
	</scroll-view>
	</view>
</template>

<script>
import HmFriendsList from '@/components/hm-friends-list/index.vue'
import {_openAll,_closeAll,_closeOneInfo,_openOneInfo} from '@/common/vmeitime-http/controller.js'
import lightSkeleton from '@/pages/controlbtn/lightskelet/light-skeleton.vue'
import Vue from 'vue'
export default {
  components: { HmFriendsList,lightSkeleton },
  data() {
    return {
		skeletonloading:1,
			list:{
					friendsList: '情景模式',
					static:1,
					list:[]
			},
					
					
    };
  },
  onShow(){
	  console.log(uni.getStorageSync('equipmentlist').SCENE_TRIGGER)
		this.list.list = uni.getStorageSync('equipmentlist').SCENE_TRIGGER
		this.skeletonloading = 0;
   },
  methods:{
    btnclick(item) {
		uni.showLoading({
			title:"操作中"
		})
		var obj = {
			  "duerosType": "SCENE_TRIGGER",
			  "equipId": this.list.list[item].equipId,
			  "hotelId": uni.getStorageSync('controller').hotleId,
			  "position": this.list.list[item].position,
			  "positionBak": this.list.list[item].positionBak,
			  "realName":uni.getStorageSync('controller').realName,
			  "roomId": uni.getStorageSync('controller').id,
			  "roomNumber": uni.getStorageSync('controller').name,
			}
		
		console.log(item)
			_openOneInfo(obj).then(res =>{
				console.log(res)
				uni.showToast({
					title:"成功"
				})
			})
		}
    }
 
};
</script>


<style>
	page{
		height: 100%;
		background-color: #F8F8F8;
		/* background: linear-gradient(to top, #22223c, #3f3f63); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
	}
	.dialogue{
		margin-top: 60rpx;
		/* padding-left: 20rpx; */
		font-size: 30rpx;
		color: #ffffff;
		display: flex;
		flex-direction: column;
		/* background-color: #24243e; */

	}
	.dialogue .right{
		height: 80rpx;
		padding: 0 25rpx 0 25rpx;
		border-radius: 25rpx;
		border-top-left-radius: 0rpx;
		/* background-color: rgb(121,125,210,0.4); */
		background-color: #FFBC15;
		display: flex;
		align-items: center;
		margin-bottom: 45rpx;
		width: fit-content;
		flex:1;
		box-shadow: 0px 1px 10px rgba(111, 113, 118, 0.5);
		margin-left: 20rpx;

	}
	.btnicon {
		width: 50rpx !important;
		height: 50rpx !important;
	}

</style>